package com.example;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

/**
 * Created with IntelliJ IDEA.
 * User: Jasic_Work
 * Date: 12-8-22
 * Time: 下午5:41
 * To change this template use File | Settings | File Templates.
 */
public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final EditText factor_01 = (EditText)findViewById(R.id.factor01);
        final EditText factor_02 = (EditText)findViewById(R.id.factor02);

        final TextView textView = (TextView)findViewById(R.id.oper);
        textView.setText(R.string.oper);
        final Button button = (Button)findViewById(R.id.button);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.putExtra("factor_01",factor_01.getText());
                intent.putExtra("factor_02",factor_02.getText());

                intent.setClass(MainActivity.this, ResultActivity.class);
                MainActivity.this.startActivity(intent);
            }
        });
    }
}
